<template>
	<view class="detailContainer">
		<!-- 内容区 -->
		<scroll-view class="content" scroll-y="true">
			<image class="detailImg" :src="goodsInfo.listPicUrl" mode=""></image>
			<view class="tag">{{goodsInfo.promTag}}</view>
			<text class="price">￥ {{goodsInfo.retailPrice}}</text>
			<view class="info">{{goodsInfo.name}}</view>

			<!-- 准备内容 -->
			<view class="list" style="margin-left: 5%;font-size: 28upx;line-height: 50upx;">
				<view>1) 100%桑蚕丝填充，丝丝精粹不掺杂</view>
				<view>2) 创新井字拉网工艺，桑蚕丝不易黏连结块</view>
				<view>3) 两种面料可选，贡缎手感细腻，竹棉清爽透气</view>
				<view>4) AB双面设计，多种活性印花不易褪色</view>
			</view>
		</scroll-view>

		<!-- 底部导航 -->
		<view class="height">
			<view class="goods">
				<uni-goods-nav @click="onClick" @buttonClick="buttonClick" />
			</view>
		</view>


	</view>
</template>

<script>
	import {
		createLogger
	} from 'vuex'
	export default {
		data() {
			return {
				goodsInfo: {}
			}
		},
		onLoad(options) {

			this.goodsInfo = JSON.parse(options.goodsInfo)
			console.log('this.goodsInfo', this.goodsInfo)
		},
		methods: {
			onClick(e) {
				console.log(e)
				uni.showToast({
					title: `点击${e.content.text}`,
					icon: 'none'
				})
			},
			buttonClick(e) {
				console.log(e)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.detailContainer {
		width: 100%;
		display: flex;
		flex-direction: column;

		.content {
			height: calc(100vh - 100rpx);

			.detailImg {
				width: 100%;
				height: 750upx;
			}

			.tag {
				width: 90%;
				height: 100upx;
				line-height: 100upx;
				text-align: center;
				font-size: 32upx;
				color: #FFFFFF;
				margin: 20upx auto;
				background: #BB2C08;
				border-radius: 10upx;
			}

			.price {
				font-size: 50upx;
				color: #DD1A21;
				line-height: 70upx;
				margin-left: 5%;
			}

			.info {
				font-size: 28upx;
				color: #333;
				margin-left: 5%;
			}
		}

		.detailFooter {
			position: fixed;
			bottom: 0;
			left: 0;
			height: 100upx;
			line-height: 100upx;
			border-top: 1upx solid #EEEEEE;
			display: flex;
			background: #fff;

			.service {
				width: 60upx;
				height: 60upx;
				margin: 20upx 40upx;
			}

			.btn {
				width: 305upx;
				height: 100%;
				text-align: center;
				font-size: 28upx;

				&.buyNow {
					color: #333;
					border-left: 1upx solid #eee;
				}

				&.addShopCart {
					background: #DD1A21;
					color: #fff;
				}
			}
		}
	}

	.height {
		height: 100rpx;

		.goods {
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			z-index: 99;
		}
	}
</style>